package code.example.javassist.code;

import java.lang.reflect.Method;

public class MethodCoder extends Coder {
    Method method  = null;
    public MethodCoder(Method method){
        this.method = method;
    }

    @Override
    public String write() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(Coder.CODE_PUBLIC);
        stringBuilder.append(Coder.CODE_SPACE);
        stringBuilder.append(method.getReturnType().getName());
        stringBuilder.append(Coder.CODE_SPACE);
        stringBuilder.append(method.getName());
        stringBuilder.append(Coder.CODE_LEFT_BRACKET);
        Class [] parameterTypes = method.getParameterTypes();
        if(parameterTypes != null){
            for(int i=0;i<parameterTypes.length;i++){
                String parameterTypeName = parameterTypes[i].getName();

            }
        }

        return super.write();
    }
}
